<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>成为商户</title>
    <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon"/>

    <!--<link type="text/css" rel="stylesheet" href="/template/default/css/font-awesome.min.css"/>-->
    <link href="https://static.9hive.cn/global/vendor/icheck/icheck.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://static.9hive.cn/global/vendor/bootstrap-3.3.7/bootstrap.min.css">
    <link href="https://static.9hive.cn/global/vendor/bootstrap-select/bootstrap-select.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/template/default/css/common.css">
    <link type="text/css" rel="stylesheet" href="/template/default/css/custom_common.css"/>

    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>

    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>
    <style>
        .layui-layer-content {
            background-color: rgba(0, 0, 0, 0.4);
            color: white;
        }


    </style>
</head>
<body>

<a class="tabbar" href="javascript:history.back(-1)" title="返回"><img
        src="/template/default/images/arrow_left_white.png"/><label>成为商户</label></a>
<div class="padding-20 ">
    <input class="hidden" value="${code!}" id="code">
    <div class="margin-top-20 text-center">
        <div>
            <label class="width-70 text-right">姓名：</label><input class="light-input width-200" id="name"/>
        </div>
        <div class="margin-top-20">
            <label class="width-70 text-right">联系方式：</label><input type="number" class="light-input width-200"
                                                                   id="phone"
                                                                   value=""/>
        </div>


        <div class="margin-top-20"><label class="width-70 text-right">微信：</label>
            <input class="light-input width-200" id="weichat"/></div>
        <div class="margin-top-20"><label class="width-70 text-right">QQ：</label>
            <input class="light-input width-200" id="qq"/></div>
        <div class="margin-top-20"><label class="width-70 text-right">产品：</label>
            <input class="light-input width-200" id="product"/></div>

        <button class="hive-btn hive-btn-primary margin-top-40 width-290" id="apply">立即加入</button>
    </div>

</div>
<script>
    $(document).on('click', '#apply', function () {

        var name = $('#name').val();
        var phone = $('#phone').val();
        var qq = $('#qq').val();
        var wechat = $('#weChat').val();
        var product = $('#product').val();
        var code = $("#code").val();
        if (!name) {
            layer.msg("请输入姓名");
            return false;
        }
        if (!phone || phone.length != 11) {
            layer.msg("请输入正确的手机号码");
            return false;
        }

        if (!wechat) {
            layer.msg("请输入微信号");
            return false;
        } else if (!product) {
            layer.msg("请输入产品");
            return false;
        }


        $.ajax({
            url: '/b/agent/applyBusinessByCode',
            data: {
                "name":name,
                "phone":phone,
                "weChat":wechat,
                "qq":qq,
                "product":product,
                code:code
            },
            success: function (data) {
                if (data.state == 'ok') {
                    layer.msg('申请成功');
                } else {
                    layer.msg(data.msg)
                }
            },

        })
    });
</script>
</body>
</html>